package com.talent.jiwen.http.api;

import com.talent.jiwen.http.common.HttpResult;
import com.talent.jiwen.http.result.AliAuthSignResult;
import com.talent.jiwen.http.result.AliPayBindInfo;
import com.talent.jiwen.http.result.AliPayBindStatus;
import com.talent.jiwen.http.result.AliPayResult;
import com.talent.jiwen.http.result.ApplyTeacherResult;
import com.talent.jiwen.http.result.CollectTeacherListResult;
import com.talent.jiwen.http.result.CouponListResult;
import com.talent.jiwen.http.result.DiscreditListResult;
import com.talent.jiwen.http.result.EvaluateListResult;
import com.talent.jiwen.http.result.EvaluateTagListResult;
import com.talent.jiwen.http.result.FinanceResult;
import com.talent.jiwen.http.result.GroupInfoResult;
import com.talent.jiwen.http.result.HomePageResult;
import com.talent.jiwen.http.result.InviteOrderResult;
import com.talent.jiwen.http.result.InvitedListResult;
import com.talent.jiwen.http.result.LoginResult;
import com.talent.jiwen.http.result.NotifyMessageResult;
import com.talent.jiwen.http.result.OrderAllResult;
import com.talent.jiwen.http.result.OrderResult;
import com.talent.jiwen.http.result.PayInfo;
import com.talent.jiwen.http.result.ReadGradeListResult;
import com.talent.jiwen.http.result.RelieveDiscreditResult;
import com.talent.jiwen.http.result.SaveOrderResult;
import com.talent.jiwen.http.result.SmsResult;
import com.talent.jiwen.http.result.StudentInfoResult;
import com.talent.jiwen.http.result.TeacherInfoResult;
import com.talent.jiwen.http.result.UpDataBean;
import com.talent.jiwen.http.result.WXPayResult;
import com.talent.jiwen.http.result.wrongbook.ErrorListBean;
import com.talent.jiwen.http.result.wrongbook.StartPracticeBean;
import com.talent.jiwen.wrongbook.data.WrongSingleData;

import java.util.Map;

import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Header;
import retrofit2.http.POST;
import rx.Observable;

/**
 * 创建接口
 * 说明：定义了一个方法getTop250,使用get请求方式，
 * 加上@GET 标签，标签后面是这个接口的 尾址top250,完整的地址应该是 baseUrl+尾址 ，
 * 参数 使用@Query标签，如果参数多的话可以用@QueryMap标签，接收一个Map
 */

public interface EducationApi {


    /**
     * android首次打开
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("open/customerCommon/androidFirstOpen")
    Observable<HttpResult<Void>> androidFirstOpen(@FieldMap Map<String, String> map);

    /**
     * 学生注册
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("open/studentCustomer/studentRegister")
    Observable<HttpResult<Void>> studentRegister(@FieldMap Map<String, String> map);


    /**
     * 学生登录
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("open/studentCustomer/studentLogin")
    Observable<HttpResult<LoginResult>> studentLogin(@FieldMap Map<String, String> map);

    /**
     * 获取短信验证码
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("open/sms/send")
    Observable<HttpResult<SmsResult>> sendMsg(@FieldMap Map<String, String> map);

    /**
     * 学生重置密码
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("open/studentCustomer/resetPassword")
    Observable<HttpResult<Void>> resetPassword(@FieldMap Map<String, String> map);


    /**
     * @author cmw
     * @description 版本更新
     */
    @FormUrlEncoded
    @POST("common/highestVersion")
    Observable<HttpResult<UpDataBean>> upDataApp(@Header("Authorization") String token, @Field("application_type") int application_type);


    /**获取邀请的学生列表
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/getInvitedStudentList")
    Observable<HttpResult<InvitedListResult>> getInvitedStudentList(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**通过手机号或邀请码获取学生信息
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/searchStudentByPhone")
    Observable<HttpResult<StudentInfoResult>> searchStudentByPhone(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**邀请学生加入群组
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/inviteStudentJoinGroup")
    Observable<HttpResult<Void>> inviteStudentJoinGroup(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**获取收藏的教师列表
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/getCollectedTeacherList")
    Observable<HttpResult<CollectTeacherListResult>> getCollectedTeacherList(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**创建群组信息
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/createGroupInfo")
    Observable<HttpResult<GroupInfoResult>> createGroupInfo(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**获取学生点读————年级列表
     *
     * @param token
     * @return
     */
     @POST("customer/studentWork/getReadGradeList")
    Observable<HttpResult<ReadGradeListResult>> getReadGradeList(@Header("Authorization") String token);

    /**学生获取首页详情
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/getHomePageInfo")
    Observable<HttpResult<HomePageResult>> getHomePageInfo(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**更新群组成员状态
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/updateGroupMemberStatus")
    Observable<HttpResult<Void>> updateGroupMemberStatus(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**保存订单信息
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/saveOrderInfo")
    Observable<HttpResult<SaveOrderResult>> saveOrderInfo(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**保存订单信息II （发布订单信息）
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/publishOrderInfo")
    Observable<HttpResult<Void>> publishOrderInfo(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**学生取消拼班（订单未立即问）
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/cancelClassOrder")
    Observable<HttpResult<Void>> cancelClassOrder(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**获取订单详情
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/getOrderDetailInfo")
    Observable<HttpResult<InviteOrderResult>> getOrderDetailInfo(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**获取教师评价列表
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/getTeacherEvaluationList")
    Observable<HttpResult<EvaluateListResult>> getTeacherEvaluationList(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**获取未接课程的列表
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/getOriginalOrder")
    Observable<HttpResult<OrderResult>> getOriginalOrder(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**获取已接单，但还未开始的订单
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/getWaitingOrderList")
    Observable<HttpResult<OrderResult>> getWaitingOrderList(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**获取完成订单
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/getCompletedOrderList")
    Observable<HttpResult<OrderAllResult>> getCompletedOrderList(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**获取申请的教师列表
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/getApplyTeacherList")
    Observable<HttpResult<ApplyTeacherResult>> getApplyTeacherList(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**接受教师
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/acceptTeacher")
    Observable<HttpResult<Void>> acceptTeacher(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**获取教师详细信息
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/getTeacherDetailInfo")
    Observable<HttpResult<TeacherInfoResult>> getTeacherDetailInfo(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**学生加入课程
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/studentJoinClass")
    Observable<HttpResult<Void>> studentJoinClass(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**学生取消订单
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/studentCancelOrder")
    Observable<HttpResult<Void>> studentCancelOrder(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**我的界面——获取学生评价列表
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/getStudentEvaluationList")
    Observable<HttpResult<EvaluateListResult>> getStudentEvaluationList(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**收藏教师
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/collectTeacher")
    Observable<HttpResult<Void>> collectTeacher(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**取消收藏教师
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/cancelCollectTeacher")
    Observable<HttpResult<Void>> cancelCollectTeacher(@Header("Authorization") String token, @FieldMap Map<String, String> map);


    /**获取订单详情（教师信息，支付价格）
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/getOrderPayInfo")
    Observable<HttpResult<PayInfo>> getOrderPayInfo(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**获取通知消息列表
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/getNotifyMessageList")
    Observable<HttpResult<NotifyMessageResult>> getNotifyMessageList(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**保存学生评价信息
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/saveCustomerEvaluation")
    Observable<HttpResult<Void>> saveCustomerEvaluation(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**保存申诉信息
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/saveAppealInfo")
    Observable<HttpResult<Void>> saveAppealInfo(@Header("Authorization") String token, @FieldMap Map<String, String> map);


    /**学生评价时，获取标签列表
     *
     * @param token
     * @return
     */
    @POST("customer/studentWork/getEvaluationTagList")
    Observable<HttpResult<EvaluateTagListResult>> getEvaluationTagList(@Header("Authorization") String token);

    /**获取学生失信列表
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/getDiscreditList")
    Observable<HttpResult<DiscreditListResult>> getDiscreditList(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**我的界面——保存学生反馈消息
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/saveUserFeedBackInfo")
    Observable<HttpResult<Void>> saveUserFeedBackInfo(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**学生我的界面——更新学生个人数据
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/updateStudentInfo")
    Observable<HttpResult<Void>> updateStudentInfo(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**学生我的界面——获取学生个人数据
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/getStudentSelfInfo")
    Observable<HttpResult<StudentInfoResult>> getStudentSelfInfo(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**我的界面——获取优惠券列表
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/getCouponList")
    Observable<HttpResult<CouponListResult>> getCouponList(@Header("Authorization") String token, @FieldMap Map<String, String> map);


    /**学生初始化支付宝支付
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/studentPayWithAliPay")
    Observable<HttpResult<AliPayResult>> studentPayWithAliPay(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**我的界面——获取学生的资金流
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/getFinanceChangeLog")
    Observable<HttpResult<FinanceResult>> getFinanceChangeLog(@Header("Authorization") String token, @FieldMap Map<String, String> map);


    /**学生初始化微信支付
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/studentPayWithWeChat")
    Observable<HttpResult<WXPayResult>> studentPayWithWeChat(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**学生余额支付
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/studentPayWithBalance")
    Observable<HttpResult<Void>> studentPayWithBalance(@Header("Authorization") String token, @FieldMap Map<String, String> map);


    /**我的——获取用户支付宝绑定状态
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/getAliPayBindStatus")
    Observable<HttpResult<AliPayBindStatus>> getAliPayBindStatus(@Header("Authorization") String token, @FieldMap Map<String, String> map);


    /**我的——用户绑定支付宝
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/updateAliPayBindInfo")
    Observable<HttpResult<AliPayBindInfo>> updateAliPayBindInfo(@Header("Authorization") String token, @FieldMap Map<String, String> map);




    /**学生缴纳保证金
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/studentRelieveDiscredit")
    Observable<HttpResult<RelieveDiscreditResult>> studentRelieveDiscredit(@Header("Authorization") String token, @FieldMap Map<String, String> map);


    /**学生充值
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/studentRecharge")
    Observable<HttpResult<RelieveDiscreditResult>> studentRecharge(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**我的——学生提现
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/userWithdraw")
    Observable<HttpResult<Void>> userWithdraw(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**我的界面——学生更新身份证号
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/updateStudentIDNumber")
    Observable<HttpResult<Void>> updateStudentIDNumber(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**
     *我的——获取alipay的签名
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/studentWork/getAliPaySign")
    Observable<HttpResult<AliAuthSignResult>> getAliPaySign(@Header("Authorization") String token, @FieldMap Map<String, String> map);


    //获取错题列表
    @FormUrlEncoded
    @POST("studentWork/getStudentWrongHomeworkList")
    Observable<HttpResult<ErrorListBean>> getStudentWrongHomeworkList(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    //获取单个错题信息
    @FormUrlEncoded
    @POST("studentWork/getStudentWrongHomeworkInfo")
    Observable<HttpResult<WrongSingleData>> getStudentWrongHomeworkInfo(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    //开始题库练习
    @FormUrlEncoded
    @POST("studentWork/studentStartHomeworkPractice")
    Observable<HttpResult<StartPracticeBean>> studentStartHomeworkPractice(@Header("Authorization") String token, @FieldMap Map<String, String> map);

}

